<template>
	<view class="detail">
	<text class="title">{{data.title}}</text>
	<view class="info">
		<text>发表时间: {{data.public_time}}</text>
		<text>浏览: {{data.click}}</text>
	</view>
	<view class="content">
		<rich-text :nodes="data.content"></rich-text>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				data:{}
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getNewsDetail()
		},
		methods: {
			async getNewsDetail(){
				const res =  await this.$myRequest({
					url:"getNewsDetail.json"
				})
				this.data = res.data.message[0]
			}
		}
	}
</script>

<style lang="scss">
	.detail {
		font-size: 30rpx;
		padding: 0 20rpx;
		.title {
			display: block;
			text-align: center;
			width: 710rpx;
			margin: 20rpx 0;
			font-weight: 600;
			font-size: 50rpx;
		}
		.info {
			display: flex;
			justify-content: space-between;
			margin-bottom: 20rpx;
		}
	}
</style>
